﻿@model RTW.OA.Models.actionpermission
@{
    ViewBag.Title = "添加权限";
    Layout = "~/Views/Shared/_LayoutBase.cshtml";
}

@section styles{

}
<div id="dMain">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox" style="margin-bottom: 0px;">
            <div class="ibox-title">
                <h4>@ViewBag.Title </h4>
            </div>
            <div class="ibox-content">
                @using (Ajax.BeginForm("AddAction", "SysMenu", new AjaxOptions() { HttpMethod = "post", OnSuccess = "afterOk" }, new { area = "System", id = "actionfrom", name = "actionfrom" }))
                {
                    @Html.AntiForgeryToken()
                    <div class="from-content">
                        <dl>
                            <dt>权限类型</dt>
                            <dd>
                                <div class="rule-multi-radio">
                                    <input name="TYPE" type="radio" value="1" /><label>路由</label>
                                    <input name="TYPE" type="radio" value="2" /><label>方法</label>
                                    <input name="TYPE" type="radio" value="3" /><label>按钮</label>
                                </div>
                            </dd>
                        </dl>
                        <dl>
                            <dt>权限名称</dt>
                            <dd>

                                @Html.EditorFor(model => model.PERMISSION_NAME, new { htmlAttributes = new { @class = "input normal form-control", datatype = "*2-100", sucmsg = " " } })

                            </dd>
                        </dl>
                        <dl>
                            <dt>权限代码</dt>
                            <dd>
                                @Html.EditorFor(model => model.PERMISSION_CODE, new { htmlAttributes = new { @class = "input normal form-control", datatype = "*2-100", sucmsg = " " } })

                            </dd>
                        </dl>
                        <dl>
                            <dt>控制器名</dt>
                            <dd>
                                @Html.EditorFor(model => model.CONTROLLER, new { htmlAttributes = new { @class = "input normal form-control" } })

                            </dd>
                        </dl>
                        <dl>
                            <dt>方法名</dt>
                            <dd>
                                <div class="form-group">
                                    <div class="input-group col-xs-12">
                                        <div class="input-group-btn">
                                            <div class="rule-single-select">
                                                <select id="METHOD_TYPE" name="METHOD_TYPE" class="form-control" style="width: auto;">
                                                    <option value="">访问方式</option>
                                                    <option value="Get">HttpGet</option>
                                                    <option value="Post">HttpPost</option>
                                                </select>
                                            </div>
                                        </div>
                                        @Html.EditorFor(model => model.ACTION, new { htmlAttributes = new { @class = "input normal form-control" } })
                                    </div>
                                </div>
                            </dd>
                        </dl>
                    </div>
                    <div class="from-footer">
                        <div class="btn-wrap" style="position: fixed;">
                            <a class="btn btn-sm btn-primary radius" onclick="savefrom()">
                                <i class="iconfont icon-save"></i>
                                提交保存
                            </a>
                            <a class="btn btn-sm btn-warning radius" onclick="parent.layer.close(parent.layer.index);">
                                <i class="iconfont icon-fanhui"></i>
                                取消关闭
                            </a>
                        </div>
                    </div>
                }
            </div>
        </div>
    </div>
</div>
@section scripts{
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/JS/common/jquery/jquery.unobtrusive-ajax.min.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Scripts/MicrosoftAjax.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Scripts/MicrosoftMvcAjax.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/JS/common/jquery/Validform_v5.3.2_min.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/JS/common/artdialog/dialog-plus-min.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/JS/common/webuploader/webuploader.min.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/JS/common/WdatePicker/WdatePicker.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/editor/ueditor.config.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/editor/ueditor.all.min.js")"></script>
    <script type="text/javascript" charset="utf-8" src="@Url.Content("~/Content/editor/lang/zh-cn/zh-cn.js")"></script>
    @*<script type="text/javascript" charset="utf-8" src="../js/uploader.js"></script>*@
    <script src="@Url.Content("~/Content/JS/common/from.js")"></script>

    <script>
        $(function () {
            //初始化表单验证
            $("#actionfrom").initValidform();
        });

        function savefrom() {
            $("#actionfrom").submit();
        }

        function afterOk(data) {
            parent.layer.close(parent.layer.index);
            parent.GetPermission(@ViewBag.MenuId);
        }
    </script>
}

